<?php
include("./include/config.inc.php");

$selectImg ="SELECT sliderImg
               FROM slider
              WHERE sliderId = ".$_GET['sliderId'];
$selectImgRes= mysql_query($selectImg);              
if($imgRow = mysql_fetch_array($selectImgRes))
{
	if($imgRow['sliderImg'] != NULL)
	{
	  unlink("sliderImage/thumb/".$imgRow['sliderImg']);
	  unlink("sliderImage/".$imgRow['sliderImg']);
	}
}

$deleteParty = "DELETE FROM slider 
                      WHERE sliderId = ".$_GET['sliderId'];
$deletePartyRes = mysql_query($deleteParty);
if(!$deletePartyRes)
{
	echo("DELETE FAIL");
}
else
{
	header("Location:slider.php");
}
?>